<template><el-row class="tac">
	<el-col :span="24">
		<el-menu class="el-menu-vertical-demo" style="height: 100%" @select="handleSelect">
			<el-menu-item :index="item.path" v-for="item in navList" :key="item.title">
				<h2 :class="{ navStyle: $route.path == item.path }">{{ item.title }}</h2>
			</el-menu-item>
		</el-menu>
	</el-col>
</el-row></template>

<script>
export default {
	name: 'Navigator',
	data() {
		return {
			// 路由列表
			navList: [
				{ title: '我的票据', path: '/home' },
				{ title: '公司列表', path: '/company' },
				{ title: '银行列表', path: '/bank' },
				{ title: '账户信息', path: '/individual' },
			],
		}
	},

	methods: {
		// 处理路由点击
		handleSelect(key) {
			if (key == this.$route.path) {
				return
			}
			this.$router.push(key)
		},
	},
}
</script>

<style>
.navStyle {
	color: #409eff !important;
}
</style>
